var 箱子名 = "副手武器";
status = -1;
var itemList = [1352206 ,1352216 ,1352226 ,1352236 ,1352246 ,1352256 ,1352266 ,1352276 ,1352286 ,1352296 ,1342095 ,1342104 ,1352906 ,1352916 ,1352928 ,1352975 ,1352935 ,1352945 ,1352957 ,1352967 ,1352707 ,1352009 ,1099012 ,1352824 ,1352109 ,1352506 ,1352406 ,1352606 ,1099011 ,1353006 ,1352815 ,1353105 ,1352807 ,1552084 ,1353205 ,1353405 ,1353306 ,1353505 ,1353606 ,1353703 ,1353807 ,1354007 ,1092087 ,1092109 ,1092113 ,1092089 ,1092110 ,1092049 ,1092111];
function start() {
    action(1, 0, 0)
}
function action(e, d, c) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }
    if (e == 1) {
        status++
    } else {
        status--
    }
    if (status == 0) {
        if (cm.getSpace(1) < 2 || cm.getSpace(2) < 2 || cm.getSpace(3) < 2 || cm.getSpace(4) < 2 || cm.getSpace(5) < 2) {
            cm.sendOk("你的背包满了，每一栏都要留2个位置。");
            cm.dispose();
            return
        }
        text = "#b请选择你要获得的#r" + 箱子名 + "#b装备：\r\n#fn方正粗黑宋简体#";
        for (var a = 0; a < itemList.length; a++) {
            text += "#L" + a + "##i" + itemList[a] + "# #b#z" + itemList[a] + "##l\r\n"
        }
        cm.askMenu(text)
    } else {
        if (status == 1) {
            cm.sendOk("获得 #b#e#v" + itemList[c] + "##z" + itemList[c] + "# #n#k确定了吗？");
            selects = c
        } else {
            if (status == 2) {
                var b = cm.gainGachaponItem(itemList[selects], 1, "" + 箱子名 + "装备箱", 3);
                cm.gainItem(2433028, 0);
                cm.dispose()
            }
        }
    }
};
